
function hashFileAysc(file) {
    const worker = new Worker(new URL('./HashWorker.js', import.meta.url));
    const hashFilePromise = new Promise((resolve, _) => {
        worker.postMessage({file: file});
        worker.onmessage = (msg) => {
            worker.terminate();
            resolve(msg.data);
        };
    });
    return hashFilePromise;
}

export default hashFileAysc;